#include "elecfans.h"

Elecfans::Elecfans(Type type) : m_type(type) {

}

QString Elecfans::name()
{
    switch (m_type) {
    case Search:
        return "电子发烧友 - 搜索";
    case Electron:
        return "电子发烧友 - 电路图";
    }
}

QString Elecfans::prefix()
{
    return "https://s.elecfans.com/s?keyword=";
}

QString Elecfans::content(const QString &text)
{
    switch (m_type) {
    case Search:
        if (text.isEmpty()) {
            return "https://s.elecfans.com";
        }
        return prefix() + text;
        // return "elecfans.com";
    case Electron:
        return "https://www.elecfans.com/dianlutu/";
    }
}
